/**
 * Created by wuli等等 on 2017/3/1.
 */
import React, { Component } from 'react';
import { View, Text ,StyleSheet,Image,TouchableNativeFeedback} from 'react-native';
import HeaderAndBack from '../component/HeaderAndBack';
import Images from '../component/Images';
import TypeToValue from '../component/TypeToValue';
import CollectionIcon from '../component/CollectionIcon';
import DriverInfo from './DriverInfo'


export default class Collections extends Component {
    static defaultProps = {
        title: 'Collections'
    };

    _onPress = () =>{
        const { navigator } = this.props;
        if(navigator) {
            navigator.push({
                component:DriverInfo,
            })
        }
    } ;

    render() {
        const { navigator } = this.props;
        return (
            <View style={styles.container}>
                <HeaderAndBack text="司机收藏" navigator = { navigator }/>
                <TouchableNativeFeedback
                    onPress={this._onPress}>
                <View style={styles.one}>
                    <View style={styles.Icon}>
                    <Images imageUrl="http://img4.duitang.com/uploads/item/201504/26/201504264843_JmYvM.jpeg"/>
                        </View>
                    <View style={styles.inf}>
                        <TypeToValue type="姓名" value="张师傅"/>
                        <TypeToValue type="性别" value="男"/>
                        <TypeToValue type="所在地" value="杭州"/>
                        <TypeToValue type="联系方式" value="18888888888"/>
                    </View>
                    <CollectionIcon/>
                </View>
                </TouchableNativeFeedback>
                <View style={styles.one}>
                    <View style={styles.Icon}>
                    <Images imageUrl="http://p0.pstatp.com/origin/3795/3044413937"/>
                    </View>
                    <View style={styles.inf}>
                        <TypeToValue type="姓名" value="唐师傅"/>
                        <TypeToValue type="性别" value="女"/>
                        <TypeToValue type="所在地" value="南京"/>
                        <TypeToValue type="联系方式" value="17777777888"/>
                    </View>

                    <CollectionIcon/>
                </View>
                <View style={styles.one}>
                    <View style={styles.Icon}>
                    <Images imageUrl="http://a1.att.hudong.com/50/06/19300534097956134693060624360.jpg"/>
                    </View>
                    <View style={styles.inf}>
                        <TypeToValue type="姓名" value="郭师傅"/>
                        <TypeToValue type="性别" value="男"/>
                        <TypeToValue type="所在地" value="武汉"/>
                        <TypeToValue type="联系方式" value="18900056789"/>
                    </View>
                    <CollectionIcon/>
                </View>
            </View>
        )
    }
}

let styles = StyleSheet.create({
    container: {
        flex: 1,
        backgroundColor:'#EDEDED',

    },
    Icon:{
        flex:3,
        justifyContent:"center",
        alignItems: 'center',
    },
    one:{
        height:95,
        flexDirection:'row',
        backgroundColor:"#ffffff",
        borderBottomWidth:1,
        borderBottomColor:"#CCCCCC",
        justifyContent: 'center',

    },
    inf:{
      flex:7,
        flexDirection:'column',
        marginLeft:10,
        paddingTop:5,
        paddingBottom:5
    },
});